home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Kara Collection
/
Kara Collection v3.0 (1996-09-12)(Cloanto).iso
/
utilities
/
h
/
0
/
6
/
2
/
rexx
/
fonttexts.ctrx
< prev
next >
Wrap
Text File
|
1996-04-11
|
2KB
|
101 lines
/* ColorType Amiga Rexx script - Copyright © 1996 Cloanto Italia srl */
/* $VER: FontTexts.ctrx 1.0 */
/**
This script creates an IFF-ILBM image file for each font in the specified
path. The images contain a short text sample, consisting of the font's name
and size.
*/
IF ARG(1, EXISTS) THEN
PARSE ARG CTPORT
ELSE
CTPORT = 'COLORTYPE'
IF ~SHOW('P', CTPORT) THEN DO
IF EXISTS('ColorType:ColorType') THEN DO
ADDRESS COMMAND 'Run >NIL: ColorType:ColorType'
DO 30 WHILE ~SHOW('P',CTPORT)
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
END
ELSE DO
SAY "ColorType could not be loaded."
EXIT 10
END
END
IF ~SHOW('P', CTPORT) THEN DO
SAY 'ColorType Rexx port could not be opened.'
EXIT 10
END
ADDRESS VALUE CTPORT
OPTIONS RESULTS
OPTIONS FAILAT 10000
LockGUI
RequestFont '"Select the Font Path"'
IF RC = 0 THEN DO
PARSE VALUE RESULT WITH '"' font_path '"'
RequestPath '"Select the Image Path"'
IF RC = 0 THEN DO
PARSE VALUE RESULT WITH '"' image_path '"'
NewFont
IF RC = 0 THEN DO
ListFonts '"'font_path'"'
IF RC = 0 THEN DO
fontlist = RESULT
tmpfname = 'T:ctrx_temp.'PRAGMA('ID')
IF OPEN('listfile', tmpfname, W) THEN DO
WRITECH('listfile', fontlist)
CALL CLOSE('listfile')
IF OPEN('listfile', tmpfname, R) THEN DO
errcode = 0
DO FOREVER
curfont = READLN('listfile')
IF EOF('listfile') THEN BREAK
LoadFont FORCE '"'font_path'"' NAME curfont
IF RC = 0 THEN DO
PARSE VALUE curfont WITH '"' fontname '"' fontsize fontstyle .
imgname = image_path
IF RIGHT(image_path,1) ~= ':' THEN
imgname = imgname || '/'
imgname = imgname || fontname'_'fontsize
IF LENGTH(fontstyle) ~= 0 THEN
imgname = imgname'_'fontstyle
DynamicView '"'fontname fontsize'"'
SaveDView '"'imgname'.pic"'
IF RC ~= 0 THEN DO
errcode = RC
IF RC = 5 THEN
errmess = 'User abort during save.'
ELSE
errmess = 'Error 'RC' during save.'
END
END
ELSE DO
errcode = RC
IF RC = 5 THEN
errmess = 'User abort during load.'
ELSE
errmess = 'Error 'RC' during load.'
END
END
CALL CLOSE('listfile')
IF errcode > 0 THEN DO
SAY errmess
RequestNotify 'PROMPT="'errmess'"'
END
END
ADDRESS COMMAND 'Delete >NIL: 'tmpfname
END
END
END
END
END
UnlockGUI